# coding=utf-8
"""
    @project: 15python_spider
    @Author：frank
    @file： 08_re_greed.py
    @date：2023/12/25 21:05
"""
import re

html = '''
    <html>
        <div><p>九霄龙吟惊天变</p></div>
        <div><p>风云际会浅水游</p></div>
    </html>
'''

# 贪婪匹配
greed_pattern = re.compile('<div><p>.*</p></div>', re.S)
r_list = greed_pattern.findall(html)

# 非贪婪匹配
not_greed_pattern = re.compile('<div><p>(.*?)</p></div>', re.S)
r_list2 = not_greed_pattern.findall(html)
print(r_list)
print(r_list2)
